package com.banwoqiche.dto;

/**
 * @time: 2022-03-30 15:15
 */
public class MyBackInfo {
    private int code;
    private String msg;
    private Object data;


    public static MyBackInfo backInfo() {
        return backInfo(null);
    }

    public static MyBackInfo backInfo(Object data) {
        return backInfo(MyBackCode.SUCCESS, "Success!", data);
    }

    public static MyBackInfo backInfo(int code, String msg, Object data) {
        return setInfo(code, msg, data);
    }
    public static MyBackInfo setInfo(int code, String msg, Object data) {
        MyBackInfo bd = new MyBackInfo();
        bd.setCode(code);
        bd.setMsg(msg);
        bd.setData(data);
        return bd;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
